<template>
	<view class="main">
		<!-- :style="{ 'background': `url(${backgroundVipUrl})` }" -->
		<view class="placeholderHeight" ></view>
		<view class="content">
			<view class="background_top" :class="{ 'background_top_vip': userInfo.mobile && userInfo.is_vip != 0 }"></view>
			<view class="content_wrap">
				<!-- 用户信息 -->
				<view class="info justify_between_center">
					<view class="info_left flex_align">
						<view class="avatar" @click="goMyHome">
							<u--image v-if="userInfo.avatar" :showLoading="true" :src="userInfo.avatar" width="120rpx" height="120rpx"
								shape="circle"></u--image>
							<u--image v-else :showLoading="true" :src="no_login" width="120rpx" height="120rpx" shape="circle"
								:lazy-load="false"></u--image>
						</view>
						<view class="info_txt">
							<view :class="['name', 'ellipsis1', userInfo ? '' : 'name1']">{{ userInfo.mobile ? userInfo.nickname : '未登录'
							}}
							</view>
							<view v-if="userInfo.is_major == 1" class="standing fz26 ellipsis1">{{ majorTypes }}
							</view>
						</view>
					</view>
					<view class="info_right fz24 flex_align" @click="goMyHome">
						个人资料
						<u-icon name="arrow-right" size="14px" color="#fff"></u-icon>
					</view>
				</view>

				<!-- 会员 -->
				<view class="vip">
					<image v-if="userInfo.is_vip == 1" class="vip_card" src="@/static/img/my/index/card-dhy.png" mode="widthFix">
					</image>
					<image v-if="userInfo.is_vip == 2 || userInfo.is_vip == 3" class="vip_card"
						src="@/static/img/my/index/card-cjhy.png" mode="widthFix"></image>
					<image v-if="userInfo.is_vip == 4 || userInfo.is_vip == 5 || userInfo.is_vip == 6" class="vip_card"
						src="@/static/img/my/index/card-qyhy.png" mode="widthFix"></image>
					<image v-if="userInfo.is_vip == 0" class="vip_null" src="@/static/img/my/index/card-null.png" mode="widthFix"
						@click="toPlatform()">
					</image>
					<view class="vip_tip flex_col" v-if="userInfo.mobile && userInfo.is_vip != 0">
						<text class="vip_text bold" :class="vipInfo.color">{{ vipInfo.text }}</text>
						<text class="vip_time" v-if="userInfo.vip_end_time_text" :class="vipInfo.timeColor">有效期至{{
							userInfo.vip_end_time_text }}</text>
					</view>

				</view>

				<!-- 金刚区 -->
				<view class="kong flex_wrap">
					<view class="kong_item justify_between_center" :style="{ 'backgroundColor': item.backgroundColor }"
						v-for="(item, index) in kongItem" :key="index" @click="jump(item)">
						<view class="kong_info">
							<view class="kong_name fs30">{{ item.name }}</view>
							<view class="kong_text fz24">{{ item.text }}</view>
						</view>
						<image class="kong_icon" :src="item.iconUrl" mode="widthFix"></image>
					</view>
				</view>

				<!-- 常用功能 -->
				<view class="often_title">常用功能</view>
				<view class="often_ul">
					<view class="often_li" v-for="(item, index) in oftenList" :key="index" @click="menuClick(item)">
						<image class="often_icon" :src="item.icon" mode="widthFix"></image>
						<view class="often_name">{{ item.name }}</view>
					</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script type="text/javascript" src="plus-confusion://../pages/my/index"></script>

<style lang="scss" scoped>
.main {
	.placeholderHeight {
		width: 100vw;
		height: var(--status-bar-height);
		// background: #E1EDFD;
		background-repeat: no-repeat;
		background-size: 100%;
	}

	.content {
		padding-top: 30px;
		position: relative;
		background-color: #fff;
		overflow: hidden;

		.background_top {
			width: 100%;
			height: 300rpx;
			position: absolute;
			left: 0;
			top: 0;
			background: url('@/static/img/my/index/bj-null.png') no-repeat;
			background-size: 100%;
		}

		.background_top_vip {
			width: 100%;
			height: 500rpx;
			position: absolute;
			left: 0;
			top: 0;
			background: url('@/static/img/my/index/bj-vip.png') no-repeat;
			background-size: 100%;
		}

		.content_wrap {
			padding: 0px 16px 15px;
			// padding-bottom: 90px;
			height: 100%;
			position: relative;

			.info {
				.info_txt {
					margin-left: 16rpx;
					color: #fff;

					.name {
						font-size: 40rpx;
						max-width: 284rpx;
					}

					.name1 {
						color: #000;
					}

					.standing {
						margin-top: 10rpx;
						max-width: 400rpx;
					}
				}

				.info_right {
					color: #fff;
				}
			}

			.vip {
				position: relative;

				.vip_card {
					margin-top: 30rpx;
					width: 680rpx;
					height: 280rpx;
				}

				.vip_null {
					margin-top: 30rpx;
					width: 680rpx;
					height: 103rpx;
				}

				.vip_tip {
					position: absolute;
					left: 74rpx;
					top: 128rpx;

					.vip_text {
						font-size: 50rpx;
					}

					.vip_time {
						margin-top: 35rpx;
						font-size: 24rpx;
					}
				}
			}


			.kong {
				margin-top: 40rpx;

				.kong_item {
					width: 330rpx;
					height: 116rpx;
					border-radius: 15rpx;
					padding: 25rpx 36rpx 20rpx;

					&:not(:nth-child(2n)) {
						margin-right: 20rpx;
					}

					&:not(:nth-child(n+2)) {
						margin-bottom: 20rpx;
					}

					.kong_info {
						height: 100%;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
					}

					.kong_name {
						font-weight: 700;
						font-size: 32rpx;
					}

					.kong_text {
						font-weight: 600;
					}

					.kong_icon {
						width: 56rpx;
						height: 56rpx;
					}
				}
			}

			.often_title {
				margin-top: 57rpx;
				font-size: 36rpx;
				font-weight: 700;
				color: #0F1322;
				line-height: 47rpx;
			}

			.often_ul {
				display: flex;
				flex-wrap: wrap;
				justify-content: flex-start;


				.often_li {
					width: 140rpx;
					margin-top: 60rpx;
					display: flex;
					flex-direction: column;
					align-items: center;

					.often_icon {
						margin-bottom: 20rpx;
						width: 46rpx;
						height: 46rpx;
					}
				}
			}
		}
	}

}

.cDhy {
	background: linear-gradient(300deg, #404966 0%, #6E84AF 100%);
	color: transparent;
	-webkit-background-clip: text;
}

.cDhy-time {
	color: #8291B6;
}

.cCjhy {
	background: linear-gradient(300deg, #7D5227 0%, #C2945A 100%);
	color: transparent;
	-webkit-background-clip: text;
}

.cCjhy-time {
	color: #BB8F60;
}


.cQyhy {
	background: linear-gradient(300deg, #D6DCF3 0%, #FDFDFE 100%);
	color: transparent;
	-webkit-background-clip: text;
}

.cQyhy-time {
	color: #A0A0BC;
}
</style>
